#pragma once


#define	LOG_MAX_POOL	10000
#define	LOG_MAX_TEXT	1024

typedef struct {
	TCHAR	szText[LOG_MAX_TEXT];
} LOGDATA, *PLOGDATA;


// CListCtrlLog

class CListCtrlLog : public CListCtrl
{
	DECLARE_DYNAMIC(CListCtrlLog)

public:
	CListCtrlLog();
	virtual ~CListCtrlLog();

	enum {
		MENU_START = 2000,
		MENU_COPY = MENU_START,
		MENU_SEL_ALL,
		MENU_CLEAR_ALL,
	};

	void logInit();
	void logMsg(TCHAR *pFormat, ...);
	void logCopy();
	void logSelectAll();
	void logClear();

private:
	CMemPool<LOGDATA>	*m_pLogPool;
	CPtrArray			m_paryLog;

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
};


